package com.djmw.mouse.util;

import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * 用户登录时，先要检查是否属于指定的角色，若不属于则不予登录。
 * 为设置此角色，重载shiro的UsernamePasswordToken。
 * 
 * @author leo
 */
public class UsernamePasswordRolesToken extends UsernamePasswordToken {
	private static final long serialVersionUID = 893328403149144980L;
	private String requiredRoles;

    public UsernamePasswordRolesToken(final String username, final String password,
            final boolean rememberMe, final String host, final String requiredRoles) {
    	super(username, password, rememberMe, host);
    	this.requiredRoles = requiredRoles;
	}

	public String getRequiredRoles() {
		return requiredRoles;
	}

	public void setRequiredRoles(String requiredRoles) {
		this.requiredRoles = requiredRoles;
	}
}
